﻿{% extends "layout/base.html" %}
{% block content %}

	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-ui-1.8.6.custom.min.js"></script>
    <script type="text/javascript" src="{{ MEDIA_URL }}js/main.js"></script>

<h1>Ajouter un trajet</h1>
<img alt="Fac by car - Co-voiturage Université de Marne-la-vallée" src="{{ MEDIA_URL }}/images/ajout-trajet-co-voiturage-4.jpg"/>

<h2>Mon trajet</h2>

<div id="block_route">
	<div class="block_route_infos">
		<h4>Départ :</h4>
		<h3 id="cityd">{{ route.city_d }}</h3>
		<p class="block_route_place" id="address">{{ route.place_d }}</p>
		<h4>Arrivée :</h4>
		<h3 id="citya">{{ route.city_a }}</h3>
		<p class="block_route_place" id="address2">{{ route.place_a }}</p>
		
		{% if route.is_driver == 1 %}
			<p class="driver">Trajet en tant que conducteur</p>
		{% else %}
			<p class="passenger">Trajet en tant que passager</p>
		{% endif %}
		
		<p>Distance : <span id="distance">...</span></p>
		<p>Durée : <span id="duree">...</span></p>
	</div>
	{% if route.is_daily == 1 %}	
	<div class="block_route_date2">
		<p>du</p>
		<h2>{{ route.date_departure }}</h2>
		<p>au</p>
		<h2>{{ daily.end_time }}</h2>
	</div>
	{% else %}
	<div class="block_route_date">
		<h2>{{ route.date_departure }}</h2>
		<p>{{ route.hour }}</p>
	</div>
	{% endif %}
	
	{% if route.is_driver == 1 %}
		<div class="block_route_nb_passenger"><span>{{ route.nb_passengers }}</span> places disponibles</div>
		<div class="block_route_price"><span>{{ route.price }} €</span> par passager</div>
	{% else %}
		<div class="block_route_required_price">Prix souhaité : <span>{{ route.price }} €</span> </div>
	{% endif %}
	<div class="clear"></div>
	
	{% if route.is_daily == 1 %}
		<p class="block_route_daily_day"><span>Trajet</span></p>
			{% if daily.date_mo != '' %}
			<div class="block_route_day" title="Lundi">L</div> 
			{% endif %}
			{% if daily.date_tu != '' %}
			<div class="block_route_day" title="Mardi">M</div> 
			{% endif %}
			{% if daily.date_we != '' %}
			<div class="block_route_day" title="Mercredi">M</div> 
			{% endif %}
			{% if daily.date_th != '' %}
			<div class="block_route_day" title="Jeudi">J</div> 
			{% endif %}
			{% if daily.date_fr != '' %}
			<div class="block_route_day" title="Vendredi">V</div> 
			{% endif %}
			{% if daily.date_sa != '' %}
			<div class="block_route_day" title="Samedi">S</div> 
			{% endif %}
			{% if daily.date_su != '' %}
			<div class="block_route_day" title="Dimanche">D</div> 
			{% endif %}
		<div class="clear"></div>
		<p class="block_route_daily_h"><span>quotidien</span></p>
			{% if daily.date_mo != '' %}
			<div class="block_route_h" title="{{ daily.date_mo }}">{{ daily.date_mo }}</div> 
			{% endif %}
			{% if daily.date_tu != '' %}
			<div class="block_route_h" title="{{ daily.date_tu }}">{{ daily.date_tu }}</div> 
			{% endif %}
			{% if daily.date_we != '' %}
			<div class="block_route_h" title="{{ daily.date_we }}">{{ daily.date_we }}</div> 
			{% endif %}
			{% if daily.date_th != '' %}
			<div class="block_route_h" title="{{ daily.date_th }}">{{ daily.date_th }}</div> 
			{% endif %}
			{% if daily.date_fr != '' %}
			<div class="block_route_h" title="{{ daily.date_fr }}">{{ daily.date_fr }}</div> 
			{% endif %}
			{% if daily.date_sa != '' %}
			<div class="block_route_h" title="{{ daily.date_sa }}">{{ daily.date_sa }}</div> 
			{% endif %}
			{% if daily.date_su != '' %}
			<div class="block_route_h" title="{{ daily.date_su }}">{{ daily.date_su }}</div> 
			{% endif %}
			
		<div class="clear"></div>
		<!--<p class="block_route_daily_day">jusqu'au <span>{{ daily.end_time }}</span></p>
		<div class="clear"></div>-->
	{% else %}
		<p><strong>Trajet ponctuel</strong></p>
	{% endif %}
	
	{% if route.is_driver == 1 %}
	<div class="block_route_car">
		<h4>Ma voiture : </h4>
		<p>{{ route.car }}</p>
	</div>
	{% endif %}
</div>

<div class="clear"></div>
<h2>Carte du trajet</h2>

<div id="map_canvas" style="width:650px; height:300px"></div>

<p class="back_espace_perso"><a href="/profile/" class="big_btn_white">Mon espace personnel</a></p>
{% endblock content %}
